/*
 * @Author: your name
 * @Date: 2020-05-19 14:06:56
 * @LastEditTime: 2020-06-03 13:50:54
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \mobile_project_0519\mobile_post\src\router\router.js
 */ 
import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter)

const routes = [{
    path:"/home",   //首页
    alias:"/",
    component:()=>import("@/pages/home/home")
},
{
    path:"/list",   //列表页
    component:()=>import("@/pages/list/list")
},
{
    path:"/shopCar",    //购物车页
    name:'shopCar',
    component:()=>import("@/pages/shopcar/shopCar")
    /*props:(route)=>{
        return{
            id:route.params.id
        }
    }*/
},
/*{
    path:"/shopCarNull",    //购物车空白页
    name:'shopCarNull',
    component:()=>import("@/pages/shopcar/components/shopCarNull")
},*/
{
    path:"/user",   //会员中心页
    name:'user',
    component:()=>import("@/pages/user/user")
},
{
    path:"/login",   //登录页
    name:'login',
    component:()=>import("@/pages/login/login")
},
{
    path:"/address",   //地址
    component:()=>import("@/pages/user/components/address")
},
{
    path:"/register",   //注册页
    component:()=>import("@/pages/register/register")
},
{
    path:"/details",    //详细商品页
    name:"/details",
    component:()=>import("@/pages/details/details"),
    props:(route)=>{
        return{
            id:route.query.id
        }
    }
}]

export default new VueRouter({
    routes
})